#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableStrongGuideTargetDao:DaoBase<TableStrongGuideTarget>
    {
        public override string GetFileName()
        {
            return "TableStrongGuideTarget.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimaryInt = new Dictionary<int, TableStrongGuideTarget>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddPrimaryIndex(TableStrongGuideTarget model)
        {
            #if UNITY_EDITOR
            if(cachePrimaryInt.ContainsKey(model.targetID)) UnityEngine.Debug.LogError("数据表id重复:TableStrongGuideTarget->id: " + model.targetID);
            #endif
            cachePrimaryInt[model.targetID] = model;
        }
        protected override TableStrongGuideTarget ParseRowData(string[] rowData)
        {
            TableStrongGuideTarget data = new TableStrongGuideTarget();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.targetID = int.Parse(rowData[0]);
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.strongGuideName = string.Intern(rowData[1]);
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.guideID = int.Parse(rowData[2]);
            }
            if (!string.IsNullOrEmpty(rowData[3]))
            {
                data.switchName = rowData[3];
            }
            if (!string.IsNullOrEmpty(rowData[4]))
            {
                data.guideType = int.Parse(rowData[4]);
            }
            if (!string.IsNullOrEmpty(rowData[5]))
            {
                data.target = string.Intern(rowData[5]);
            }
            if (!string.IsNullOrEmpty(rowData[6]))
            {
                data.explanatoryText = string.Intern(rowData[6]);
            }
            return data;
        }
    }
}
